﻿Imports ModuloVendas
Imports ModuloEstoque
Public Class MovimentacaoUC
    Sub AtualizaSize()
        Dim Agendamento, Compra, Venda As String
        Agendamento = ""
        Compra = ""
        Venda = ""
        Dim i As Integer

        TSLAgendamento.Text = ""
        TSLCompra.Text = ""
        TSLVendaOrca.Text = ""

        TSLAgendamento.Text = Agendamento
        For i = Me.Size.Width / 7 To Len(TSLAgendamento.Text) Step Me.Size.Width / 7
            TSLAgendamento.Text = TSLAgendamento.Text.Insert(i, vbCrLf)
        Next
        TSLCompra.Text = Compra
        For i = Me.Size.Width / 7 To Len(TSLCompra.Text) Step Me.Size.Width / 7
            TSLCompra.Text = TSLCompra.Text.Insert(i, vbCrLf)
        Next
        TSLVendaOrca.Text = Venda
        For i = Me.Size.Width / 7 To Len(TSLVendaOrca.Text) Step Me.Size.Width / 7
            TSLVendaOrca.Text = TSLVendaOrca.Text.Insert(i, vbCrLf)
        Next
    End Sub

    Private Sub MovimentacaoUC_Resize(sender As System.Object, e As System.EventArgs) Handles MyBase.Resize
        AtualizaSize()
    End Sub

    Private Sub TSBAgendamento_Click(sender As System.Object, e As System.EventArgs) Handles TSBAgendamento.Click
        frmPrincipal.TPMovimentacao.Controls.Clear()
        Dim uc = New AgendamentoUC()
        uc.Dock = DockStyle.Fill
        frmPrincipal.TPMovimentacao.Controls.Add(uc)
    End Sub

    Private Sub TSBVendaOrca_Click(sender As System.Object, e As System.EventArgs) Handles TSBVendaOrca.Click
        frmPrincipal.TPMovimentacao.Controls.Clear()
        Dim uc = New OrdemServicoUC()
        uc.Dock = DockStyle.Fill
        frmPrincipal.TPMovimentacao.Controls.Add(uc)
    End Sub

    Private Sub TSBCompra_Click(sender As System.Object, e As System.EventArgs) Handles TSBCompra.Click
        frmPrincipal.TPMovimentacao.Controls.Clear()
        Dim uc = New ComprasUC
        uc.Dock = DockStyle.Fill
        frmPrincipal.TPMovimentacao.Controls.Add(uc)
    End Sub

    Private Sub TSBVenda_Click(sender As System.Object, e As System.EventArgs) Handles TSBVenda.Click
        frmPrincipal.TPMovimentacao.Controls.Clear()
        Dim uc = New VendaUC
        uc.Dock = DockStyle.Fill
        frmPrincipal.TPMovimentacao.Controls.Add(uc)
    End Sub
End Class
